const app = getApp();
const Controller = require('../controllers/controllers.js').controller;
const util = require('../../utils/util.js');

Page({
  data: {
    loading: false,
    contentlistdata:[],
    bottomLift: 0,
  },
 
  onLoad() {
    let {bottomLift} = app.globalData
    if(bottomLift>=0){
      app.getDeviceSize().then(res => {
        const {bottomLift} = res
        this.setData({
          bottomLift
        })
      })
    }else{
      this.setData({
        bottomLift
      })
    }
    this.categorylist()
  },
  categorylist(){
    Controller.categorylist().then(res=>{
      if(res.data.baseData){
        this.setData({
          contentlistdata:res.data.baseData
        })
      }
    })
  },
  golink(e){
    wx.navigateTo({
      url:e.currentTarget.dataset.url
    });
  },
  onPageScroll: function (e) { // 获取滚动条当前位置
    
  },
  onShareAppMessage: function (e) {
    
  },
  onShareTimeline: function(res){
    
  },
})